import gevent
from gevent import monkey
import time

monkey.patch_all()


def eat():
    print('张三在吃饭!')
    time.sleep(2)
    print('张三吃完了饭!')


def play():
    print('张三在打游戏!')
    time.sleep(1)
    print('张三游戏失败!')


g1 = gevent.spawn(eat)
g2 = gevent.spawn(play)
g1.join()
g2.join()
print('主程序')

